<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The IntlBreakIterator class</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="transliterator.transliterate.html">Transliterator::transliterate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlbreakiterator.construct.html">IntlBreakIterator::__construct</a></div>
 <div class="up"><a href="book.intl.html">intl</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="class.intlbreakiterator" class="reference">

 <h1 class="title">The IntlBreakIterator class</h1>
 

 <div class="partintro"><p class="verinfo">(No version information available, might only be in Git)</p>


  <div class="section" id="intlbreakiterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    A “break iterator” is an ICU object that exposes methods for locating
    boundaries in text (e.g. word or sentence boundaries).
    The PHP <strong class="classname">IntlBreakIterator</strong> serves as the the base class
    for all types of ICU break iterators. Where extra functionality is
    available, the intl extension may expose the ICU break iterator with
    suitable subclasses, such as
    <a href="class.intlrulebasedbreakiterator.html" class="classname">IntlRuleBasedBreakIterator</a> or
    <strong class="classname">IntlCodePointBreaIterator</strong>.
   </p>
   <p class="para">
    This class implements <strong class="classname">Traversable</strong>. Traversing an
    <strong class="classname">IntlBreakIterator</strong> yields non-negative integer
    values representing the successive locations of the text boundaries,
    expressed as UTF-8 code units (byte) counts, taken from the beggining of
    the text (which has the location <em>0</em>). The keys yielded
    by the iterator simply form the sequence of natural numbers
    <em>{0, 1, 2, …}</em>.
   </p>
  </div>


  <div class="section" id="intlbreakiterator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">IntlBreakIterator</strong>
     </span>

     <span class="oointerface">implements 
      <span class="interfacename"><strong class="interfacename">Traversable</strong></span>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.done"><var class="varname">DONE</var></a></var>
     <span class="initializer"> = -1</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-none"><var class="varname">WORD_NONE</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-none-limit"><var class="varname">WORD_NONE_LIMIT</var></a></var>
     <span class="initializer"> = 100</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-number"><var class="varname">WORD_NUMBER</var></a></var>
     <span class="initializer"> = 100</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-number-limit"><var class="varname">WORD_NUMBER_LIMIT</var></a></var>
     <span class="initializer"> = 200</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-letter"><var class="varname">WORD_LETTER</var></a></var>
     <span class="initializer"> = 200</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-letter-limit"><var class="varname">WORD_LETTER_LIMIT</var></a></var>
     <span class="initializer"> = 300</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-kana"><var class="varname">WORD_KANA</var></a></var>
     <span class="initializer"> = 300</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-kana-limit"><var class="varname">WORD_KANA_LIMIT</var></a></var>
     <span class="initializer"> = 400</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-ideo"><var class="varname">WORD_IDEO</var></a></var>
     <span class="initializer"> = 400</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-ideo-limit"><var class="varname">WORD_IDEO_LIMIT</var></a></var>
     <span class="initializer"> = 500</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-soft"><var class="varname">LINE_SOFT</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-soft-limit"><var class="varname">LINE_SOFT_LIMIT</var></a></var>
     <span class="initializer"> = 100</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-hard"><var class="varname">LINE_HARD</var></a></var>
     <span class="initializer"> = 100</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-hard-limit"><var class="varname">LINE_HARD_LIMIT</var></a></var>
     <span class="initializer"> = 200</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-term"><var class="varname">SENTENCE_TERM</var></a></var>
     <span class="initializer"> = 0</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-term-limit"><var class="varname">SENTENCE_TERM_LIMIT</var></a></var>
     <span class="initializer"> = 100</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-sep"><var class="varname">SENTENCE_SEP</var></a></var>
     <span class="initializer"> = 100</span>
    ;</div>

    <div class="fieldsynopsis">
     <span class="modifier">const</span>
     <span class="type">integer</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-sep-limit"><var class="varname">SENTENCE_SEP_LIMIT</var></a></var>
     <span class="initializer"> = 200</span>
    ;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">private</span> <span class="methodname"><a href="intlbreakiterator.construct.html" class="methodname">__construct</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.createcharacterinstance.html" class="methodname">createCharacterInstance</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;locale&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.createcodepointinstance.html" class="methodname">createCodePointInstance</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.createlineinstance.html" class="methodname">createLineInstance</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;locale&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.createsentenceinstance.html" class="methodname">createSentenceInstance</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;locale&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.createtitleinstance.html" class="methodname">createTitleInstance</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;locale&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.createwordinstance.html" class="methodname">createWordInstance</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;locale&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.current.html" class="methodname">current</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.first.html" class="methodname">first</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.following.html" class="methodname">following</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;offset&quot;</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.geterrorcode.html" class="methodname">getErrorCode</a></span>
    ( <span class="methodparam">void</span>
    )</div>
<div class="methodsynopsis dc-description">
   <span class="type">ReturnType</span><span class="methodname"><strong>intl_get_error_code</strong></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.geterrormessage.html" class="methodname">getErrorMessage</a></span>
    ( <span class="methodparam">void</span>
    )</div>
<div class="methodsynopsis dc-description">
   <span class="type">ReturnType</span><span class="methodname"><strong>intl_get_error_message</strong></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.getlocale.html" class="methodname">getLocale</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;locale_type&quot;</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.getpartsiterator.html" class="methodname">getPartsIterator</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;key_type&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.gettext.html" class="methodname">getText</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.isboundary.html" class="methodname">isBoundary</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;offset&quot;</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.last.html" class="methodname">last</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.next.html" class="methodname">next</a></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;offset&quot;</code></span>
  ] )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.preceding.html" class="methodname">preceding</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;offset&quot;</code></span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.previous.html" class="methodname">previous</a></span>
    ( <span class="methodparam">void</span>
   )</div>
<div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">ReturnType</span><span class="methodname"><a href="intlbreakiterator.settext.html" class="methodname">setText</a></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$&quot;text&quot;</code></span>
   )</div>

   }</div>


  </div>


  <div class="section" id="intlbreakiterator.constants">
   <h2 class="title">预定义常量</h2>
   <dl>


    
     <dt id="intlbreakiterator.constants.done"><strong><code>IntlBreakIterator::DONE</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-none"><strong><code>IntlBreakIterator::WORD_NONE</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-none-limit"><strong><code>IntlBreakIterator::WORD_NONE_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-number"><strong><code>IntlBreakIterator::WORD_NUMBER</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-number-limit"><strong><code>IntlBreakIterator::WORD_NUMBER_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-letter"><strong><code>IntlBreakIterator::WORD_LETTER</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-letter-limit"><strong><code>IntlBreakIterator::WORD_LETTER_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-kana"><strong><code>IntlBreakIterator::WORD_KANA</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-kana-limit"><strong><code>IntlBreakIterator::WORD_KANA_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-ideo"><strong><code>IntlBreakIterator::WORD_IDEO</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.word-ideo-limit"><strong><code>IntlBreakIterator::WORD_IDEO_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.line-soft"><strong><code>IntlBreakIterator::LINE_SOFT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.line-soft-limit"><strong><code>IntlBreakIterator::LINE_SOFT_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.line-hard"><strong><code>IntlBreakIterator::LINE_HARD</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.line-hard-limit"><strong><code>IntlBreakIterator::LINE_HARD_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.sentence-term"><strong><code>IntlBreakIterator::SENTENCE_TERM</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.sentence-term-limit"><strong><code>IntlBreakIterator::SENTENCE_TERM_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.sentence-sep"><strong><code>IntlBreakIterator::SENTENCE_SEP</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

    
     <dt id="intlbreakiterator.constants.sentence-sep-limit"><strong><code>IntlBreakIterator::SENTENCE_SEP_LIMIT</code></strong></dt>

     <dd>

      <p class="para"/>
     </dd>

    

   </dl>

  </div>



 </div>

 




















































































































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="intlbreakiterator.construct.html">IntlBreakIterator::__construct</a> — Private constructor for disallowing instantiation</li><li><a href="intlbreakiterator.createcharacterinstance.html">IntlBreakIterator::createCharacterInstance</a> — Create break iterator for boundaries of combining character sequences</li><li><a href="intlbreakiterator.createcodepointinstance.html">IntlBreakIterator::createCodePointInstance</a> — Create break iterator for boundaries of code points</li><li><a href="intlbreakiterator.createlineinstance.html">IntlBreakIterator::createLineInstance</a> — Create break iterator for logically possible line breaks</li><li><a href="intlbreakiterator.createsentenceinstance.html">IntlBreakIterator::createSentenceInstance</a> — Create break iterator for sentence breaks</li><li><a href="intlbreakiterator.createtitleinstance.html">IntlBreakIterator::createTitleInstance</a> — Create break iterator for title-casing breaks</li><li><a href="intlbreakiterator.createwordinstance.html">IntlBreakIterator::createWordInstance</a> — Create break iterator for word breaks</li><li><a href="intlbreakiterator.current.html">IntlBreakIterator::current</a> — Get index of current position</li><li><a href="intlbreakiterator.first.html">IntlBreakIterator::first</a> — Set position to the first character in the text</li><li><a href="intlbreakiterator.following.html">IntlBreakIterator::following</a> — Advance the iterator to the first boundary following specified offset</li><li><a href="intlbreakiterator.geterrorcode.html">IntlBreakIterator::getErrorCode</a> — Get last error code on the object</li><li><a href="intlbreakiterator.geterrormessage.html">IntlBreakIterator::getErrorMessage</a> — Get last error message on the object</li><li><a href="intlbreakiterator.getlocale.html">IntlBreakIterator::getLocale</a> — Get the locale associated with the object</li><li><a href="intlbreakiterator.getpartsiterator.html">IntlBreakIterator::getPartsIterator</a> — Create iterator for navigating fragments between boundaries</li><li><a href="intlbreakiterator.gettext.html">IntlBreakIterator::getText</a> — Get the text being scanned</li><li><a href="intlbreakiterator.isboundary.html">IntlBreakIterator::isBoundary</a> — Tell whether an offset is a boundaryʼs offset</li><li><a href="intlbreakiterator.last.html">IntlBreakIterator::last</a> — Set the iterator position to index beyond the last character</li><li><a href="intlbreakiterator.next.html">IntlBreakIterator::next</a> — Advance the iterator the next boundary</li><li><a href="intlbreakiterator.preceding.html">IntlBreakIterator::preceding</a> — Set the iterator position to the first boundary before an offset</li><li><a href="intlbreakiterator.previous.html">IntlBreakIterator::previous</a> — Set the iterator position to the boundary immediately before the current</li><li><a href="intlbreakiterator.settext.html">IntlBreakIterator::setText</a> — Set the text being scanned</li></ul>
</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="transliterator.transliterate.html">Transliterator::transliterate</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intlbreakiterator.construct.html">IntlBreakIterator::__construct</a></div>
 <div class="up"><a href="book.intl.html">intl</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
